<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./include/modules/Site/classes/PhpFox_ComponentContentPage.class.php, $Author:  $ */



/** Component for building site content pages
 * @version $Id: PhpFox_ComponentContentPage.class.php 46 2007-12-14 23:12:21Z phpfoxsv $
 * @package module.site
 *
 */
class PhpFox_Mod_Site_ComponentContentPage extends BaseComponent
{
    function process()
    {
    	$oReq = &App::getRequest();

	  	$sFile = ($this->getParam('file') ? $this->getParam('file') : $oReq->get('file'));

	  	$sDir = $oReq->get('dir');

	  	$oLang = &App::getLanguage();
	  	$sOut = $oLang->getContent($sFile, true);
        $sTitle = '';
        $aContent = App::getParam('Mod_Site.content_page', $sDir);
        if (isset($aContent[$sFile]))
        {
            $sTitle = $aContent[$sFile];
        }

        $sOut = str_replace('{%SITENAME%}', App::getSetting('site_name'), $sOut);
        $this->oTpl->assignSrc('sContent', $sOut);
        $this->oTpl->assign('sTitle', $sTitle);
        $this->oTpl->assign('sDoSearch', App::makeUrl('admin.language.phrases', array('lreturn' => $sFile, 'lpopup' => $this->getParam('popup'),'content' => 'true', 'csearch' => str_replace("_", "-", $sFile))));
        if ($this->getParam('popup'))
        {
            return $this->oTpl->fetch('PopupContent.html');
        }
        return $this->oTpl->fetch('Content.html');
    }
}
?>